<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>

	<body>
		<div>
			<input type="text" id="src" value="" />
			<button onclick="generate()">生成</button>
			<h4>结果</h4>
			<textarea id="result" cols="70" rows="10">无</textarea>
			<h4>预览</h4>
			<pre id="preview">无</pre>
			<p>使用 console.log (结果)或 alert(结果) 显示。</p>
			<p id="charset"></p>
		</div>
	</body>
	<script src="js/osGenerator.js" type="text/javascript" charset="utf-8"></script>
	<script>
		var charset=os.getCharset();
		document.getElementById('charset').innerHTML='支持字符：'+charset;
		function generate() {
			var src = document.getElementById('src').value;
			var result = os.generate(src);
			document.getElementById('result').innerHTML = result;
			if (result.indexOf('~') != 0) {
				var preview = eval(result);
				document.getElementById('preview').innerHTML = preview;
			}
		}
	</script>

</html>